#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask,render_template,request,redirect
from course_v1 import *
import time,json

# 创建程序
app = Flask(__name__)

#
@app.route("/",methods = ['GET','POST'])
def index():
    #风景园林设计
    data = HtmlGetter("1903060106","1903060106a").get_course_info()
    if data:
        #此时会自动找templates文件夹中的hello.html
        return render_template("index.html",data = data)


@app.route("/shijia",methods = ['GET','POST'])
def shijia():
    #食品加工技术
    data = HtmlGetter("1905080101","1905080101a").get_course_info()
    if data:
        #此时会自动找templates文件夹中的hello.html
        return render_template("index.html",data = data)


@app.route("/shuichan",methods = ['GET','POST'])
def shuichuan():
    #水产养殖技术
    data = HtmlGetter("1905080108","1905080108a").get_course_info()
    if data:
        #此时会自动找templates文件夹中的hello.html
        return render_template("index.html",data = data)


@app.route("/shumei",methods = ['GET','POST'])
def shumei():
    # 数字媒体应用技术
    data = HtmlGetter("2004090114","2004090114a").get_course_info()
    if data:
        #此时会自动找templates文件夹中的hello.html
        return render_template("index.html",data = data)


@app.route("/qiying",methods = ['GET','POST'])
def qiying():
    # 汽车营销与服务
    data = HtmlGetter("2002060242","2002060242a").get_course_info()
    if data:
        #此时会自动找templates文件夹中的hello.html
        return render_template("index.html",data = data)



if __name__=='__main__':
    app.run(host = "0.0.0.0",port= 8080,debug = False)
